]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
windowMenu: Close when corresponding window goes away
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 21 May 2015 16:14:51 +0000 (18:14 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 21 May 2015 16:20:39 +0000 (18:20 +0200)
The menu is clearly associated with a particular window, so keeping
it around when the window is gone doesn't make sense - in case of
the window menu, it is actually harmful as every action will act on
the invalidated window and result in a crash. So just dismiss the
menu when the menu is unmanaged.

https://bugzilla.gnome.org/show_bug.cgi?id=749529

js/ui/windowMenu.js

index a314821317b51370db8d20baa09dffe4efdf6b06..1f26eb4c09d4e817de42fa7d8176e1a7fe700351 100644 (file)
@@ -200,6 +200,10 @@ const WindowMenuManager = new Lang.Class({
         menu.connect('activate', function() {
             window.check_alive(global.get_current_time());
         });
+        let destroyId = window.connect('unmanaged',
+            function() {
+                menu.close();
+            });
 
         this._sourceActor.set_size(rect.width, rect.height);
         this._sourceActor.set_position(rect.x, rect.y);
@@ -213,6 +217,7 @@ const WindowMenuManager = new Lang.Class({
 
             this._sourceActor.hide();
             menu.destroy();
+            window.disconnect(destroyId);
         }));
     }
 });